package xyz.xuetu.www.consumer;

import xyz.xuetu.www.common.model.User;
import xyz.xuetu.www.common.service.UserService;
import xyz.xuetu.www.rpc.proxy.ServiceProxyFactory;

public class RegistryConsumerExample {

    public static void main(String[] args) {
        for (int i = 0;i < 3;i++) {
            UserService userService = ServiceProxyFactory.getProxy(UserService.class);
            User user = new User(1L, "admin", "123");
            User newUser = userService.getOne(user);
            if(newUser != null) {
                System.out.println(newUser.getUsername());
            }else {
                System.err.println("null");
            }
        }
    }
}
